function adjustImageBanner($img, $parent) {
    var w_w = $parent.width(),
        w_h = $parent.height(),
        r_w = w_h / w_w,
        i_w = $img.width(),
        i_h = $img.height(),
        r_i = i_h / i_w,
        new_w, new_h,
        new_left, new_top;
    if (r_w > r_i) {
        new_h = w_h;
        new_w = w_h / r_i;
    }
    else {
        new_h = w_w * r_i;
        new_w = w_w;
    }
    $img.css({
        width: new_w + 'px',
        height: new_h + 'px',
        left: (w_w - new_w) / 2 + 'px',
        top: (w_h - new_h) / 2 + 'px'
    });
}

$(document).ready(function () {
    $('.bxslider').bxSlider({
        pager:false
    });

    $('.partner-slider').slick({
        dots: false,
        infinite: true,
        speed: 300,
        slidesToShow: 4,
        centerMode: true,
        variableWidth: true,
        autoplay: true
    });

    $('#btn-mobile').click(function(){
        $('#main-mobile').toggleClass('hide-menu');
    });

    $('.fancybox').fancybox();

    if ($('#product-slider').length > 0){
        $('#product-slider').slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            arrows: true,
            //fade: true,
            infinite: true,
            autoplay: true,
            autoplaySpeed: 7000,
            dots: true
        });
    }

});